@extends('shared.adminBase')
@section('title','角色管理')
@section('content')
    <section class="content-header">
        <h1>角色管理</h1>
        <ol class="breadcrumb">
            <li><a href="{{URL::action('AdminController@innerIndex')}}"><i class="fa fa-home"></i> 首页</a></li>
            <li class="active">角色管理</li>
        </ol>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-xs-12">
                <!-- /.box -->
                <div class="box">
                    <div class="box-header"></div>
                    <!-- /.box-header -->
                    <div class="box-body">
                        <div id="example1_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">

                            <div class="row col-sm-12">
                                <button class="btn btn-default"
                                        onclick="window.location.href='{{URL::action('AdminController@addManagerRole')}}'">
                                    新增
                                </button>
                            </div>
                            <div class="row">
                                <div class="col-sm-12">
                                    <table id="example1" class="table table-bordered table-striped dataTable"
                                           role="grid" aria-describedby="example1_info">
                                        <thead>
                                        <tr role="row">
                                            <th>名称</th>
                                            <th>描述</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @foreach($roles as $item)
                                            <tr role="row" class="odd">
                                                <td>{{$item->name}}</td>
                                                <td>{{$item->description}}</td>
                                                @if($item->manager_role_id!=App\Framework\Config\SystemConstant::SUPER_MANAGER_ROLE_ID)
                                                    <td>
                                                        <a href="{{URL::action('AdminController@editManagerRole',['id'=>$item->manager_role_id])}}" class="btn-xs btn-default">编辑</a>
                                                        <a href="{{URL::action('AdminController@setPermission',['id'=>$item->manager_role_id])}}" class="btn-xs btn-default">配置权限</a>
                                                    </td>
                                                @else
                                                    <td>&nbsp;</td>
                                                @endif
                                            </tr>
                                        @endforeach
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </section>
@endsection
<script type="text/javascript">

</script>
